home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes ƒ / Full scroll right.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.2 KB  |  42 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 3
  4. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  5. #define theWindowWidth (boundsRect.right-boundsRect.left)
  6.  
  7. pascal short FullScrollLR(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Take the whole screen - the righthand strip; move it into the whole screen
  10.    shifted right by BoxSize; take the righthand strip of the source window and
  11.    move it into the lefthand strip of the dest.  */
  12.    
  13. pascal short FullScrollLR(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  14. {
  15.     short            x;
  16.     Rect            theRect, dest;
  17.     short            BoxSize;
  18.     
  19.     BoxSize=theWindowWidth/25;
  20.     
  21.     dest = boundsRect;
  22.     dest.right=dest.left+BoxSize;                /* lefthand strip */
  23.     
  24.     SetRect(&theRect, boundsRect.right-BoxSize, boundsRect.top, boundsRect.right, boundsRect.bottom);
  25.     
  26.     for(x = theWindowWidth - BoxSize; x >= 0; x -= BoxSize)
  27.     {
  28.         StartTiming();
  29.         ScrollTheRect(&boundsRect, BoxSize, 0, 0L);
  30.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  31.                 &theRect, &dest, 0, 0L);
  32.         theRect.right-=BoxSize;
  33.         theRect.left-=BoxSize;
  34.         TimeCorrection(CorrectTime);
  35.     }
  36.     
  37.     CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  38.         &boundsRect, &boundsRect, 0, 0L);
  39.     
  40.     return 0;
  41. }
  42.